<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="t" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<ul class="nav" style="margin: 0">
    <li  class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <i class="icon-comment-alt icon-animated-vertical icon-only"></i>
            <c:if test="${totalAnotacoes > 0}">
                <span class="badge badge-info">${totalAnotacoes}</span>
            </c:if>
            <c:if test="${totalAnotacoes == 0}">
                <span class="badge">${totalAnotacoes}</span>
            </c:if>

        </a>
        <ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-closer">
            <li class="nav-header">
                <i class="icon-comment-alt"></i> ${totalAnotacoes} Observações
            </li>

            <c:forEach var="anotacao" items="${anotacoes}">

                <li>
                    <a href="#">
                        <img alt="Foto do Usuário" class="msg-photo" src="<c:url value='/assets/avatars/user.jpg'/>" />
                        <span class="msg-body">
                            <span class="msg-title">
                                <span class="blue">${anotacao.user}:</span>
                                ${anotacao.texto}
                                <c:if test="${anotacao.visibleInWebpage ==  true}">
                                    <span data-rel="tooltip" data-placement="bottom" title="Visível na Página Web"><i class="icon-eye-open"></i></span>
                                    </c:if>
                                    <c:if test="${anotacao.visibleInWebpage == false}">
                                    <span data-rel="tooltip" data-placement="bottom" title="Não Visível na Página Web"><i class="icon-eye-close"></i></span>                
                                    </c:if>
                            </span>
                            <span class="msg-time">
                                <i class="icon-time"></i> <span>${anotacao.dataCriacaoFormatted}</span>
                                &nbsp;&nbsp;&nbsp;
                                <span>
                                    <c:if test="${userLogin.equals(anotacao.user)}">
                                        <button onclick="removeAnotacao(${anotacao.id}, '${anotacao.objectId}', 'MINI')" class="btn btn-minier btn-danger"><i class="icon-only icon-trash"></i></button>
                                    </c:if>
                                </span>
                            </span>
                        </span>
                    </a>



                </li>

            </c:forEach>

            <li>
                <a href="javascript:newAnotacao('${objectId}', 'MINI')">

                    Novo Comentário

                </a>
            </li>									

        </ul>
    </li>
</ul>

